package com.yeqian.user.entity;


import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Data;
import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.Collection;

@Data
@TableName(value = "userInfo")
public class UserInfo  implements UserDetails, Serializable {

    private static final long serialVersionUID=1L;

    @TableId(value = "ID", type = IdType.ASSIGN_UUID)
    private String id;

    @TableField("image")
    private String image;

    @TableField("email")
    private String email;

    @TableField("userDesc")
    private String userDesc;

    @TableField("username")
    private String username;

    @TableField("password")
    @JsonIgnore
    private String password;

    @TableField("phone")
    private String phone;

    @TableField("lastLoginTime")
    private LocalDateTime lastLoginTime;

    @TableField("salt")
    private String salt;

    @TableField("sex")
    private String sex;

    @TableField("createUser")
    private String createUser;

    @TableField("createTime")
    private LocalDateTime createtime;

    @TableField("updateUser")
    private String updateUser;

    @TableField("updateTime")
    private LocalDateTime updatetime;

    @TableField("deleteUser")
    private String deleteUser;

    @TableField("deleteTime")
    private LocalDateTime deletetime;

    @TableField("deleteFlag")
    private String deleteflag;

    @TableField("porder")
    private Integer porder;


    @Override
    public Collection<? extends GrantedAuthority> getAuthorities() {
        return null;
    }

    @Override
    public boolean isAccountNonExpired() {
        return false;
    }

    @Override
    public boolean isAccountNonLocked() {
        return false;
    }

    @Override
    public boolean isCredentialsNonExpired() {
        return false;
    }

    @Override
    public boolean isEnabled() {
        return false;
    }
}
